﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hallenberg.SmartClient.Interfaces
{
    public interface IEntityTranslatorService
    {
        bool CanTranslate(Type targetType, Type sourceType);
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Makes the code more logical to use, since the interface also has a Translate<T>")]
        bool CanTranslate<TTarget, TSource>();
        object Translate(Type targetType, object source);
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Removes the need for unnecessary casts in the client code")]
        TTarget Translate<TTarget>(object source);
        void RegisterEntityTranslator(IEntityTranslator translator);
        void RemoveEntityTranslator(IEntityTranslator translator);
    }
}
